package org.example;

import java.util.ArrayList;
import java.util.Collection;

/**
 * @version: 1
 * @description: java
 * @author: java
 * @create: 2020-06-04 12:14
 **/
public class TestGeneric3 {
    public static <T extends Persons> void test(T t) {
        System.out.println(t);
    }

    public static void main(String[] args) {
/*        test(new Persons());
        test(new Student());
        test(new Creature());*/
//        Persons[] personss = null;
        Collection<?> c = new ArrayList<String>();
//        c.add(new Object()); // 编译时错误
    }
}

class Creature {
}

class Persons extends Creature {
}

class Student extends Persons {
}

